<template>
	<div>
		<home-search></home-search>
		<home-tab></home-tab>
    <keep-alive>
    <div id="home_scroll" class="home_scroll" ref="home_scroll">
      <div>
  		<home-swiper :list="swiperList"></home-swiper>
      <home-icon :icon_list="icon_list" :icon_img="icon_img"></home-icon>
      <home-coupon :coupon_list="coupon_list"></home-coupon>
      <home-seckill :seckill_list="seckill_list" :seckill_link="seckill_link" :seckill_tit="seckill_tit"></home-seckill>
      <goods-list1 :goods_list_data="goods_list1_data" :goods_list_img="goods_list1_img"></goods-list1>
      <goods-list1 :goods_list_data="goods_list1_2_data" :goods_list_img="goods_list1_2_img"></goods-list1>
      <goods-list2 :goods_list2_data="goods_list2_data" :goods_list2_title="goods_list2_title"></goods-list2>

      </div>
    </div>   
    </keep-alive>
	</div>
</template>

<script>
import HomeSearch from './components/HomeSearch.vue'
import HomeTab from './components/Hometab.vue'
import HomeSwiper from '@/common/CommonSwiper.vue'
import HomeIcon from './components/HomeIcon.vue'
import HomeCoupon from './components/HomeCoupon.vue'
import HomeSeckill from './components/HomeSeckill.vue'
import GoodsList1 from '@/common/GoodsList1.vue'
import GoodsList2 from '@/common/GoodsList2.vue'
import Bscroll from 'better-scroll'
export default {
  name: 'Home',
  props:{
    swiperList:Array,
    icon_img:String,
    icon_list:Array,
    coupon_list:Array,
    seckill_link:String,
    seckill_list:Array,
    seckill_tit:String,
    goods_list1_data:Array,
    goods_list1_img:String,
    goods_list1_2_data:Array,
    goods_list1_2_img:String,
    goods_list2_data:Array,
    goods_list2_title:String
  },
  components:{
  	HomeSearch,
  	HomeTab,
  	HomeSwiper,
    HomeIcon,
    HomeCoupon,
    HomeSeckill,
    GoodsList1,
    GoodsList2
  },
  mounted(){
    this.$nextTick(() => {
      if(!this.scroll){
        this.scroll=new Bscroll(this.$refs.home_scroll)
      }else{
        this.scroll.refresh()
      }
    })
  }

}
</script>

<style lang="stylus" scoped>
.home_scroll{overflow:hidden;position:absolute;left:0;top:1.8rem;right:0;bottom:1rem;background:#f7f7f7;}
</style>